package class4;

/**
 * https://leetcode.cn/problems/power-of-three/
 * 3的幂
 * 解题思路：1162261467 % n == 0
 */
public class Code09_isPowerOfThree {
    public static void main(String[] args) {
        int x = 3;
        boolean powerOfThree = isPowerOfThree(x);
        System.out.println("powerOfThree = " + powerOfThree);
    }

    public static boolean isPowerOfThree(int n) {
        return n > 0 && (1162261467 % n == 0);
    }
}
